home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / overview / optimization tn demos / cbufffilestream / helloworld.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  2.3 KB  |  62 lines

  1. /*
  2.     File:        HelloWorld.c
  3.  
  4.     Contains:    Test Jig.
  5.  
  6.                 How to use this test jig
  7.                 I'm lazy, I never put this all together.
  8.                 So, it's left as an exercise to the student.
  9.                 If you want to run a test, first compilt his will the TestRandom line as the
  10.                 only test line uncommented.
  11.                 This will create a file called sizelist which is a list of the random
  12.                 sizes to write.
  13.                 Then, comment that out and make the DoWriteTest line the only one
  14.                 that is uncommented.
  15.                 Run it and it will create a file called testfile which contains the test
  16.                 data. It is a good idea to delete this file between tests to be sure to
  17.                 be testing all the same parts of the file system each time.
  18.                 When you want to test reading, make sure you have a both "testfile" and
  19.                 "sizelist" already generated and make the DoReadTest line the only one uncommented.
  20.  
  21.                 See the file CTestJig.c for info on how to compare buffered vs. nonbuffered.
  22.  
  23.     Written by:    Steve Bollinger
  24.  
  25.     Copyright:    Copyright (c) 1999 Apple Computer, Inc., All Rights Reserved.
  26.  
  27.                 You may incorporate this Apple sample source code into your program(s) without
  28.                 restriction. This Apple sample source code has been provided "AS IS" and the
  29.                 responsibility for its operation is yours. You are not permitted to redistribute
  30.                 this Apple sample source code as "Apple sample source code" after having made
  31.                 changes. If you're going to re-distribute the source, we require that you make
  32.                 it clear in the source that the code was descended from Apple sample source
  33.                 code, but that you've made changes.
  34.  
  35. */
  36.  
  37. #include <stdio.h>
  38. #include <stdlib.h>
  39. #include <time.h>
  40.  
  41. #include "RandomTestJig.h"
  42. #include "CTestJig.h"
  43.  
  44. int main(void)
  45. {
  46.     printf ("Hello World, this is CodeWarrior!\n\n");
  47.  
  48.     srand(time(NULL));    
  49.     printf ("This project uses the SIOUX console library: choose 'Quit' from the file menu to quit.\n\n");
  50.     printf ("For more information on the ANSI C library and the Metrowerks additions, ");
  51.     printf ("including SIOUX, see the C Library Reference in the Metrowerks Documentation folder.\n\n");
  52.     
  53.     printf ("To locate the right ANSI library for your preferences, see the CodeWarrior User's Guide.\n");
  54.  
  55. // Test lines are here.
  56. //    TestRandom();
  57. //    printf ("Time in ticks: %lu\n",DoWriteTest());
  58.     printf ("Time in ticks: %lu\n",DoReadTest());
  59.  
  60.     return 0;
  61. }
  62.